<?php
require('src/Cliente.class.php');
$id = (isset($_GET['id'])) ? $_GET['id']:0;
$tpoPer = 0;
$ci_rif = "";
$razonS = "";
$tlfOfi = "";
$tlfMov = "";
$tlfAdi = "";
$emailC = "";
$direcF = "";
if($id!=0){    
    $obj    = new Cliente();
    $res    = $obj->getConsulta($id);
    if( $row = mysql_fetch_array( $res ) ){
        $tpoPer = $row["CLI_TIPOPERSONA"];
	$ci_rif = $row["CLI_RIF"];
        $razonS = $row["CLI_RAZONSOCIAL"];
        $tlfOfi = $row["CLI_TLFOFICINA"];
        $tlfMov = $row["CLI_TLFMOVIL"];
        $tlfAdi = $row["CLI_TLFADICIONAL"];
        $emailC = $row["CLI_EMAIL"];
        $direcF = $row["CLI_DIRECCION"];

    }
}
?>

<form id="formID" class="z-form " method="post" action="">
    <div class="row">
    <div class="cell">
        <label><span class="required">*</span>Tipo Persona</label>
        <?php
            if($tpoPer==0){ ?>
                <input type="radio" id="tpoPer" name="tpoPer" value="1" class="validate[required] radio"> Persona Natural
                <input type="radio" id="tpoPer" name="tpoPer" value="2" class="validate[required] radio"> Persona Jur&iacute;dica
        <?php
            }else if($tpoPer==1){ ?>
                <input type="radio" id="tpoPer" name="tpoPer" value="1" checked="checked"> Persona Natural
                <input type="radio" id="tpoPer" name="tpoPer" value="2" > Persona Jur&iacute;dica
        <?php
            }else if($tpoPer==2){ ?>
                <input type="radio" id="tpoPer" name="tpoPer" value="1" > Persona Natural
                <input type="radio" id="tpoPer" name="tpoPer" value="2" checked="checked" > Persona Jur&iacute;dica
        <?php
            }
        ?>
        </div>
    </div>
    <div class="clear"></div>
    <div class="row">
        <div class="cell">
            <label><span class="required">*</span>CI/RIF</label>
            <input name="ci_rif" class="validate[required, minSize[3],maxSize[20]] text-input" type="text" id="ci_rif" value="<?php echo $ci_rif; ?>" />
        </div>
        <div class="cell">
            <label><span class="required">*</span>Nombre/Raz&oacute;n Social</label>
            <input name="razonS" class="validate[required, minSize[3],maxSize[150] text-input meddium" type="text"  id="razonS" value="<?php echo $razonS ; ?>"/>
        </div> 
    </div>
	<div class="clear"></div>
    <div class="row">
        <div class="cell">
            <label><span class="required">*</span>Telf. Oficina</label>
            <input name="tlfOfi" class="validate[required, minSize[11],maxSize[11], custom[integer]] text-input" type="text" id="tlfOfi" value="<?php echo $tlfOfi; ?>" />
        </div>
        <div class="cell">
            <label><span class="required">*</span>Telf. Movil</label>
            <input name="tlfMov" class="validate[required, minSize[11],maxSize[11], custom[integer]] text-input " type="text"  id="tlfMov" value="<?php echo $tlfMov; ?>"/>
        </div> 
        <div class="cell">
            <label>Telf. Adicional</label>
            <input name="tlfAdi" class="validate[minSize[11],maxSize[11], custom[integer]] text-input " type="text"  id="tlfAdi" value="<?php echo $tlfAdi; ?>"/>
        </div> 
	</div>
	<div class="row">
        <div class="cell">
            <label><span class="required">*</span>Correo Electr&oacute;nico</label>
            <input name="emailC" class="validate[required, minSize[3],maxSize[45]] text-input meddium" type="text"  id="emailC" value="<?php echo $emailC ; ?>"/>
        </div>
    </div>
	<div class="row">
        <div class="cell">
            <label><span class="required">*</span>Direcci&oacute;n</label>
            <textarea rows="2" cols="20" class="full" name="direcF" id="direcF" class="validate[required, minSize[3],maxSize[10], custom[integer]] text-input"><?php echo $direcF; ?></textarea>
        </div>
    </div>    
</form>

